<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var n = 0;

        function a() {
            var n = 10;

            function b() {
                n++;
                console.log(n); // 11
            }
            b();
            return b;
        }
        var c = a();
        c(); //12
        console.log(n); // 0
    </script>
</body>

</html>